/**
 * 
 */
package com.cmpanyandi.elearning.wordsdriller.model;

import android.database.Cursor;

import com.cmpanyandi.elearning.utils.db.DBBean;

/**
 * This database bean provides two additional attributes name and description.
 * @author wojtek
 *
 */
public abstract class DictionaryDB extends DBBean {

    public static final String NAME = "name";
    public static final String DESCRIPTION = "description";
    
    /** name of dictionary */
    private String name;

    /** dictionary description */
    private String description;

    public String getName() {
	return name;
    }

    public void setName(String name) {
	getContentValues().put(NAME, name);
	this.name = name;
    }

    public String getDescription() {
	return description;
    }

    public void setDescription(String description) {
	getContentValues().put(DESCRIPTION, description);
	this.description = description;
    }
    
    @Override
    public void initFromCursor(Cursor cursor) {

	super.initFromCursor(cursor);
	setName(cursor.getString(cursor.getColumnIndexOrThrow(NAME)));
	setDescription(cursor.getString(cursor.getColumnIndexOrThrow(DESCRIPTION)));

    }
}
